home *** CD-ROM | disk | FTP | other *** search
- function jumpKey()
- {
- var _loc1_ = Key.getCode();
- if(_loc1_ == 32 || _loc1_ == 38)
- {
- bod_mc.jump();
- }
- }
- var pGameOverTimer;
- this.onEnterFrame = function()
- {
- tx = 0;
- if(Key.isDown(37))
- {
- tx -= 2;
- }
- if(Key.isDown(39))
- {
- tx += 2;
- }
- if(Key.isDown(40))
- {
- tx = 0;
- }
- this.bod_mc.nudge(tx);
- this.camera_mc.render();
- };
- if(jumpListener != undefined)
- {
- Key.removeListener(jumpListener);
- jumpListener = undefined;
- }
- var jumpListener = new Object();
- jumpListener.onKeyDown = jumpKey;
- Key.addListener(jumpListener);
- this.gameOver = function(tWinLose)
- {
- var _loc1_ = this;
- Key.removeListener(jumpListener);
- delete onEnterFrame;
- if(tWinLose == "win")
- {
- _loc1_.snd_mc.win();
- _loc1_.bod_mc.gameComplete();
- }
- else
- {
- _loc1_.snd_mc.lose();
- _loc1_.bod_mc.gameOver();
- }
- pGameOverTimer = setInterval(moveOn,4000);
- };
- this.moveOn = function()
- {
- clearInterval(pGameOverTimer);
- play();
- };
- snd_mc.playgamemusic();
- stop();
-